package com.klikmee.sms.core.base.dao;

import java.util.List;

import com.klikmee.sms.core.model.DistributionList;

public class DistributionListDAO extends AbstractDAO<DistributionList> {
	public DistributionListDAO() {
		super(DistributionList.class);
	}
	
	@SuppressWarnings("unchecked")
	public List<DistributionList> findByMTSServiceId(String serviceId){
		return entityManager.createNamedQuery( "DistributionList.findByMTSServiceId" ).setParameter( "mtsServiceId", serviceId).getResultList();
	}

	public DistributionList findByMtsServiceIdAndMtsListId( String serviceId, String distributionList ) {
		return (DistributionList)entityManager.createNamedQuery( "DistributionList.findByMTSListIdAndMTSServiceId" )
		.setParameter( "mtsServiceId", serviceId)
		.setParameter( "mtsListId", distributionList )
		.getSingleResult();
		
	}
	
	
	
	
}
